package com.ts.animal.domain;

import java.io.Serializable;
import java.util.Date;


/**
 * 预警记录
 *
 * @author bobby
 * @email bobby@126.com
 * @date 2022-09-17 16:12:15
 */
public class ExWarningDO {
    //持续异常时间数据 或者 持续异常次数数据
    public static class AbnormalData {
        //最早异常时间
        Date earliestAbnormalTime;

        //本次异常时间  若出现异常数据设置
        Date currentAbnormalTime;

        //连续异常次数  若出现正常这判断是否等于或者超过阈值  超过则记录告警
        int continuousAbnormalTimes = 0;

        //是否告警
        Boolean warn = false;

        //告警信息
        String warnInfo;

        //当前数据（心跳或者耳标数据）记录
        Object currentData;

        public Date getEarliestAbnormalTime() {
            return earliestAbnormalTime;
        }

        public void setEarliestAbnormalTime(Date earliestAbnormalTime) {
            this.earliestAbnormalTime = earliestAbnormalTime;
        }

        public Date getCurrentAbnormalTime() {
            return currentAbnormalTime;
        }

        public void setCurrentAbnormalTime(Date currentAbnormalTime) {
            this.currentAbnormalTime = currentAbnormalTime;
        }

        public int getContinuousAbnormalTimes() {
            return continuousAbnormalTimes;
        }

        public void setContinuousAbnormalTimes(int continuousAbnormalTimes) {
            this.continuousAbnormalTimes = continuousAbnormalTimes;
        }

        public Boolean getWarn() {
            return warn;
        }

        public void setWarn(Boolean warn) {
            this.warn = warn;
        }

        public String getWarnInfo() {
            return warnInfo;
        }

        public void setWarnInfo(String warnInfo) {
            this.warnInfo = warnInfo;
        }

        public Object getCurrentData() {
            return currentData;
        }

        public void setCurrentData(Object currentData) {
            this.currentData = currentData;
        }
    }

    //没有数据上传
    public static class NonUploadData  {
        //最早上传时间  第一次设置为：查询开始时间
        Date earliestUploadTime;

        //本次上传时间  第一次设置为：查询开始时间
        //循环到有正常数据设置   earliestUploadTime=currentUploadDataTime; currentUploadDataTime = 数据时间; 对比currentUploadDataTime和earliestUploadTime 是否超过阈值
        //循环结束要设置  earliestUploadTime=currentUploadDataTime; currentUploadDataTime = 查询结束时间; 对比currentUploadDataTime和earliestUploadTime 是否超过阈值
        Date currentUploadDataTime;

        //是否告警 超过阈值设置为true
        Boolean warn = false;
        //告警信息
        String warnInfo;

        //当前数据（心跳或者耳标数据）记录
        Object currentData;

        public Date getEarliestUploadTime() {
            return earliestUploadTime;
        }

        public void setEarliestUploadTime(Date earliestUploadTime) {
            this.earliestUploadTime = earliestUploadTime;
        }

        public Date getCurrentUploadDataTime() {
            return currentUploadDataTime;
        }

        public void setCurrentUploadDataTime(Date currentUploadDataTime) {
            this.currentUploadDataTime = currentUploadDataTime;
        }

        public Boolean getWarn() {
            return warn;
        }

        public void setWarn(Boolean warn) {
            this.warn = warn;
        }

        public String getWarnInfo() {
            return warnInfo;
        }

        public void setWarnInfo(String warnInfo) {
            this.warnInfo = warnInfo;
        }

        public Object getCurrentData() {
            return currentData;
        }

        public void setCurrentData(Object currentData) {
            this.currentData = currentData;
        }
    }
}
